package com.ex.phanso;

import java.util.ArrayList;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

import com.ex.phanso.gui.Giaodien;
import com.ex.phanso.myinterface.CommonItf;
import com.ex.phanso.myinterface.IOItf;
import com.ex.phanso.myinterface.PhansoItf;

public class main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		IOItf io = new IOPhanso();
		
		final ArrayList<PhansoItf> listPs = io.getPhanso();
		
		if (listPs.size()>0) {
			CommonItf cm = new Common();
			
			PhansoItf tong = cm.cong(listPs.get(0), listPs.get(1));
			
			System.out.println(tong.toString());
		}
		
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				Giaodien gd = new Giaodien();
				gd.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				gd.setSize(400, 200);
				gd.setVisible(true);
				
				gd.setPhanso((Phanso)listPs.get(0), (Phanso)listPs.get(1));
			}
		});
		
		
	}

}
